import type { Role } from '../role/type'

export interface IUpdateUserProfile {
	nickName: string
	phoneNumber: string
	email: string
	sex: number
}

export interface UserQueryParams {
	deptId?: number
	userName: string
	phoneNumber: string
	status: string
	'params[beginTime]'?: string
	'params[endTime]'?: string
}

export interface User {
	createBy: string
	createTime: string
	updateBy: string
	updateTime: string
	remark: string
	id: number
	deptId: number
	userName: string
	nickName: string
	email: string
	phoneNumber: string
	sex: number
	avatar: string
	password: string
	status: number
	delFlag: string
	loginIp: string
	loginDate: string
	dept: Dept
	roles: Role[]
	roleIds: number[]
	postIds: number[]
	roleId: number | null
	admin: boolean
}

export interface UserParams {
	nickName: string
	deptId?: number
	phoneNumber: string
	email: string
	userName: string
	password: string
	sex: number
	status: number
	postIds: number[]
	roleIds: number[]
	remark: string
}
export interface Dept {
	createBy: string
	createTime: string
	updateBy: string
	updateTime: string
	remark: string
	deptId: number
	parentId: number | null
	ancestors: string | null
	deptName: string
	orderNum: number | null
	leader: string | null
	phone: string | null
	email: string | null
	status: string | null
	delFlag: string | null
	parentName: string | null
	children: Dept[]
}

export interface DeptTree {
	id: number
	label: string
	disabled: boolean
	children?: DeptTree[]
}
type permissions = '*:*:*'
type role = 'admin' | 'editor' | string

export interface IUserInfoRes {
	isDefaultModifyPwd: boolean
	isPasswordExpired: boolean
	permissions: [] | permissions[]
	roles: [] | role[]
	user: {
		avatar: string
		nickName: string
		phoneNumber: string
	}
	// introduction: string
	// avatar: string
	// name: string
	// routes: any[]
}

export interface IProfile {
	postGroup: string
	roleGroup: string
	data: UserInfo
}

export interface UserInfo {
	id: number
	remark: string | null
	isDeleted: number
	userName: string
	nickName: string
	sex: number
	avatar: string
	password: string
	status: number
	sysCode: string
	userClient: string
	userType: string
	userCategory: string
	realName: string
	nation: string
	birthday: string
	idType: string
	idNumber: string
	authority: string
	cardExpStart: string
	cardExpEnd: string
	cardAddress: string
	realNameStatus: number
	realNameTime: string
	email: string
	phoneNumber: string
	emergencyContact: string
	emergencyPhone: string
	address: string
	wechatMid: string
	wechatOpenid: string
	alipayUserid: string
	faceAuth: string
	fingerAuth: string
	orgId: string
	deptId: number
	dept: null | Dept
}
